package xin.yangshuai.redis01.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import xin.yangshuai.redis01.service.OrderService;

@RestController
@RequestMapping("order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("add")
    public void addOrder() {
        orderService.addOrder();
    }

    @GetMapping
    public String getOrderById(@RequestParam("keyId") Integer keyId) {
        return orderService.getOrderById(keyId);
    }

    @GetMapping("cluster-test")
    public void clusterTest() {
        orderService.clusterTest();
    }
}
